<template>
  <div>
    <van-nav-bar
      title="列表页面"
      left-text="返回"
      @click-left="onClickLeft"
      @click-right="onClickRight"
      left-arrow
    >
      <template #right>
        <van-icon name="cart-o" size="18" />
      </template>
    </van-nav-bar>
    <!-- 筛选 -->
    <van-dropdown-menu :overlay="soverlay">
      <van-dropdown-item title="综合" />
      <van-dropdown-item title="销量" />
      <van-dropdown-item title="价格" />
      <van-dropdown-item title="筛选" />
    </van-dropdown-menu>
    <van-divider />
    <!-- //正文 -->
    <div
      style="display: flex; width: 100%; padding: 1%"
      v-for="(image, index) in liset"
      :key="index"
    >
      <div style="width: 40%">
        <img :src="image.cover" style="width: 90%" />
      </div>
      <div class="leist" style="display: inline-block; width: 60%">
        <div style="font-size: 19px; font-weight: boldr">{{ image.title }}</div>
        <div style="font-size: 14px; color: rgb(90, 89, 89)">
          {{ image.desc }}
        </div>
        <div class="wenzi">{{ image.min_oprice }}</div>
        <P class="size">{{ shili }}</P>
      </div>
    </div>
  </div>
</template>
<script>
import { Toast } from "vant";
import { getliebiao } from "../lib/liebiao";
export default {
  data() {
    return {
      soverlay: "",
      chuanshun: "",
      liset: [],
      shili: "1348 条 评论 98% 满意",
    };
  },
  created() {
    console.log(this.$route.query);
    console.log(this.$route.query._value);
    this.chuanshun = this.$route.query._value;
    getliebiao(this.chuanshun).then((res) => {
      console.log(res);
      this.liset = res.data.hotList;
    });
  },
  methods: {
    onClickLeft() {
      //   Toast('返回');
      this.$router.push({
        name: "Home",
      });
    },
    onClickRight() {
      Toast("按钮");
    },
  },
};
</script>
<style >
.wenzi {
  color: orange;
  font-size: 15px;
  font-weight: bold;
  line-height: 2;
}
.leist {
  padding-right: 4%;
}
.size {
  font-size: 16px;
  color: rgb(90, 89, 89);
}
</style>
